
<script type="text/javascript">
	layui.use('layer', function() {
		var $ = layui.$;
		var ctxPath = '${ctxPath}';
		var checkIds = $("#${inputId}").val();
		$("#${domId}").click(function() {
			layer.open({
				type : 2,
				title : '选择菜单',
				shadeClose : true,
				shade : 0.8,
				area : [ '400px', '500px' ],
				content : ctxPath + '/common/selectroles?roleIds=' + checkIds,
				btn : [ '确定', '取消' ],
				yes : function(index, layero) {
					var nodes = frames['layui-layer-iframe' + index].getValue();
					
					if(null != nodes && nodes.length > 0) {
						var texts = "";
						var ids = "";
						for(var i = 0; i < nodes.length; i++) {
							var node = nodes[i];
							texts = texts + node.text + ",";
							ids = ids + node.id + ",";
						}
						$("#${inputName}").val(texts.substr(0, texts.length - 1));
						$("#${inputId}").val(ids.substr(0, ids.length - 1));
					}
					
					
					
					//关闭窗口
					layer.close(index);
				}
			});
		});
	})
</script>